using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RebelStar.Engine.Sprites;

namespace RebelStar.Engine.Graphics.MDX
{
    class MDXSurface : ISurface
    {
        readonly SpriteBatch batch;

        public MDXSurface(SpriteBatch batch)
        {
            this.batch = batch;
        }

        public bool BeginDraw()
        {
            batch.Begin();
            return true;
        }
        public void DrawSprite(SpriteBase sprite, Vector2 position, Rectangle sourceRectangle, Color blendColor, float scale)
        {
            batch.Draw(
                sprite.Texture,
                position,
                sourceRectangle,
                blendColor,
                0f, new Vector2(0, 0),
                scale,
                SpriteEffects.None, 1);
        }
        public void EndDraw()
        {
            batch.End();
        }

        public void Copy(ISurface source)
        {
//            MDXSurface src = source as MDXSurface;
//            if (src!=null)
//                source.Copy(src.batch.);
        }
    }
}
